
	package Loaded;

	use strict;
	use warnings;
	use Module::Info;

	sub versions {
		my @modules;
		my $max = 0;
		foreach my $module ( sort keys %INC ) {
			$module =~ s/\.pm$//;
			$module =~ s/\//::/g;
			next if $module =~ /^::/;
			next if __PACKAGE__ eq $module;
			if ( length $module > $max ) {
				$max = length $module;
			}
			my $mod = Module::Info->new_from_loaded($module);
			push @modules =>
			  [ $module, $mod ? $mod->version : 'Could not load' ];
		}
		@modules = sort { $a->[0] cmp $b->[0] } @modules;
		$max += 2;
		no warnings 'uninitialized';
		return join "\n", map { sprintf "%-${max}s %s", @$_ } @modules;
	}

	1;

